import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/data/entities/closure/access_record_entity.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/access_record/assess/detail/car/assess_record.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/access_record/assess/detail/car/basic_info.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/access_record/assess/detail/person/basic_info.dart';

/// 出入记录-详情
class AssessTab extends StatelessWidget {
  AssessTab({super.key});

  // 1: 人员 2: 车辆
  final int type = Get.arguments['type'] as int;

 final AccessRecordEntity item = Get.arguments['item'] as AccessRecordEntity;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppBar(
        titleText: '详情',
      ),
      body: DefaultTabController(
          length: 2,
          child: Column(children: [
            Container(
              height: 54.w,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(8.r),
              ),
              child: TabBar(
                tabs: const [
                  Tab(text: '基本信息'),
                  Tab(text: '出入记录'),
                ],
                dividerColor: Colors.transparent,
                labelPadding: EdgeInsets.only(bottom: 20.w),
                labelStyle: TextStyle(
                  fontSize: 16.sp,
                  fontWeight: FontWeight.w500,
                ),
                unselectedLabelStyle: TextStyle(
                  fontSize: 16.sp,
                  fontWeight: FontWeight.w500,
                ),
                labelColor: Colors.black,
                unselectedLabelColor: const Color(0xffA0A7B5),
                indicatorPadding: EdgeInsets.only(top: 35.w, bottom: 10.w),
                indicator: const BoxDecoration(
                  image: DecorationImage(
                    image: AssetImage(
                      AppImages.icon_app_work_plan,
                    ),
                  ),
                ),
              ),
            ),
            Expanded(
              child: Container(
                color: const Color(0xffF5F5F6),
                child: TabBarView(
                  children: type == 1 ? [
                    AssessBasicInfo(item: item),
                    AssessRecordCar(item: item)
                  ] : [
                    AssessBasicInfoCar(item: item),
                    AssessRecordCar(item: item)
                  ],
                ),
              ),
            ),
          ])),
    );
  }
}
